<template>
    <div>
        <h1>{{ num }}</h1>
    </div>
</template>

<script>
export default {
    name: 'one',
    data() {
        return {
            num: 1
        }
    },
    created() {
        this.$store.commit('changeTwo', this.one);
    },
    computed: {
        one() {
            return this.$store.state.one;
        }
    },
    watch: {
        one() {
            this.num = this.one;
        }
    },
};
</script>